package com.hwl.demo12.service.impl;

import com.hwl.demo12.entity.Work;
import com.hwl.demo12.service.State;

/**
 * 下午工作状态
 *
 * @author sentry
 * @since 2023-03-20
 */
public class AfternoonState extends State {
    @Override
    public void writeProgram(Work w) {
        if (w.getHour() < 17) {
            System.out.println("当前时间：" + w.getHour() + "点 下午状态还是不错，继续努力");
        } else {
            w.setState(new EveningState());
            w.writeProgram();
        }
    }
}
